package net.dataforte.tooonebee.log4j;

import java.util.Comparator;

import org.apache.log4j.Logger;

public class LoggerComparator implements Comparator<Logger>{

	@Override
	public int compare(Logger o1, Logger o2) {
		
		String o1name = o1.getName();
		String o2name = o2.getName();
		
		if("root".equals(o1name)) {
			return -1;
		}
		if("root".equals(o2name)) {
			return 1;
		}
		return o1name.compareTo(o2name);
	}

}
